home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / COMMUNIC / H191.ZIP / CA29-3.EXE / OUTDIR.CMD < prev    next >
OS/2 REXX Batch file  |  1993-02-13  |  2KB  |  59 lines

  1. ; ----- INDIR: Load the dialing directory from an ASCII file
  2. ; ----------------------------------------------------------------
  3. ;    Note: This script writes to the filele DIALING.TXT.  The file
  4. ;    is given AN ASCII file format.    Records have the structure:
  5. ;
  6. ;  Col: 0          38            57              61
  7. ;    +-----+-/ /-+-----+-----+-/ /-+-----+-----+-/ /-+-----+-//
  8. ;    !  Entry name      !  Phone number   ! Speed          !
  9. ;    +-----+-/ /-+-----+-----+-/ /-+-----+-----+-/ /-+-----+-//
  10. ;         !           !             +--------- 4 chars
  11. ;         !           +--------------------------- 14 chars
  12. ;         +--------------------------------------------- 24 chars
  13. ;
  14. ;  Col:       61    62      63    64    65    66      67    68    69    70
  15. ;          +-----+-----+-----+-----+-----+-----+-----+-----+-----+-//
  16. ;          !     !  P  !    !  D  !     !  S  !    !  E  !     !
  17. ;          +-----+-----+-----+-----+-----+-----+-----+-----+-----+-//
  18. ;               !       !           !       +--- Echo Y/N
  19. ;               !       !           +--------------- Stop 1/2
  20. ;               !       +--------------------------- Data 7/8
  21. ;               +--------------------------------------- Parity E/N/O
  22. ;
  23. ;  Col:       70        78
  24. ;          +-----+-/ /-+-----+
  25. ;          ! Script file    !
  26. ;          +-----+-/ /-+-----+
  27. ;               +--------------------------------------- 8 chars
  28. ;
  29. ;    2/93: R.McG PRESERVE directory entry name...
  30. ; ----------------------------------------------------------------
  31. ;
  32. ;    Open the output file, purgins if it exists
  33. ;
  34.     FOPENO "DIALING.TXT" TEXT
  35.     LEGEND "OutDir: Dialing directory output"
  36. ;
  37. ;    Write 100 lines of output
  38. ;
  39.     FOR N0 = 1,100
  40.         DIRECTO S0 N0    ; Entry name
  41.         PRESERVE S0     ; Retain !s, etc
  42.         IF NOT STRCMP S0(0:5) "......" ; Skip empty entries
  43.            LEGEND "OutDir: Entry # "*N0*" output"
  44.            DNUMBER S1 N0    ; Entry number
  45.            DPARMS  S2 N0    ; Entry parameters
  46.            DSCRIPT S3 N0    ; Script name when used
  47.            UPPER S3     ; Make upper case
  48.            S0(38:79) = S1    ; Put 'em together
  49.            S0(57:79) = S2
  50.            S0(70:79) = S3
  51.            WRITE S0 79    ; Write to disc
  52.            WRITE "!" 1
  53.            ENDIF
  54.         ENDFOR
  55. ;
  56. ;    And close the output file
  57. ;
  58.     FCLOSEO
  59.